package dlb.busstop.utils;

import android.content.Context;
import android.graphics.Color;

import com.github.johnpersano.supertoasts.SuperToast;
import com.github.johnpersano.supertoasts.SuperToast.Animations;
import com.github.johnpersano.supertoasts.SuperToast.Duration;

import dlb.busstop.R;

public class ToastMaker{

	public static SuperToast GetToast(Context context, int color, String text){
		SuperToast toast = new SuperToast(context);
		toast.setAnimations(Animations.FLYIN);
		toast.setDuration(Duration.SHORT);
		toast.setText(text);
		toast.setTextColor(Color.WHITE);
		
		switch (color) {
		case Color.YELLOW:
			toast.setBackgroundResource(R.drawable.bg_yellow_shape);
			break;
		case Color.BLUE:
			toast.setBackgroundResource(R.drawable.bg_blue_shape);
			break;
		case Color.RED:
			toast.setBackgroundResource(R.drawable.bg_red_shape);
			break;
		case Color.GREEN:
			toast.setBackgroundResource(R.drawable.bg_green_shape);
			break;
			default:break;
		}
		return toast;
	}
}
